import MySQLdb
from DatabaseConnector import connection_hosrep

strip_list = []
def LoadStripList():
    for line in file("./LexSCT/strip_list","r"):
        line = str(line)
        strip_list.append(line)
#    print strip_list
    
def TextStrip():
    LoadStripList()
    cursor = connection_hosrep.cursor()
    cursor.execute("SELECT r.`ResultText` FROM resulttext_table r where r.`RequestID` = 1")
    
    text  = cursor.fetchone()
    text = str(text).strip('"(),')
    for strip_word in strip_list:
        print strip_word
        text = text.strip(strip_word)
        print text
        
if __name__ == "__main__":
    TextStrip()
